<?php

namespace app\common\validate\User;

//引入底层的验证器类
use think\Validate;

/**
 * 用户消费记录验证器
 */
class Record extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'point' => 'number|egt:0',  //给字段设置 >= 0
        'content' => 'require', //必填
        'state' => 'require|number|in:1,2,3,4,5,6,-1',  //给字段设置范围
        'userid' => 'require', //必填
    ];

    /**
     * 提示消息
     */
    protected $message = [
        'point.number'    => '积分必须是个数字',
        'point.egt'    => '积分值必须是大于等于0',
        'content.require' => '消费描述必填',
        'state.require'    => '状态必填',
        'state.number'    => '状态必须是一个数字',
        'userid.require'  => '用户信息未知',
    ];
    
    /**
     * 验证场景
     */
    protected $scene = [
    ];
}